<template>
  <el-container>
    <el-header>
        <el-row>
           <el-col :span="6">
             <div class="tleft">青爱科技</div>
           </el-col>
           <el-col :span="6" :offset="12">
             <div>登陆</div>
           </el-col>
        </el-row>
    </el-header>
    <el-container>
      <el-aside width="200px">
        <el-col :span="24">
          <el-menu
            default-active="2"
            class="el-menu-vertical-demo"
            @open="handleOpen"
            @close="handleClose"
            router
            background-color="#444444"
            text-color="#fff"
          >
            <el-menu-item index="/system">
              <i class="el-icon-menu"></i>
              <span slot="title">系统数据{{token}}</span>
            </el-menu-item>
            <el-submenu index="2">
              <template slot="title">
                <i class="el-icon-message"></i>
                <span>用户管理</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="user">用户列表</el-menu-item>
                <el-menu-item index="userinfo">用户信息</el-menu-item>
              </el-menu-item-group>
            </el-submenu>
            <el-submenu index="3">
              <template slot="title">
                <i class="el-icon-goods"></i>
                <span>商品管理</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="goodslist">商品列表</el-menu-item>
                <el-menu-item index="goods">添加商品</el-menu-item>
              </el-menu-item-group>
            </el-submenu>
             <el-submenu index="4">
              <template slot="title">
                <i class="el-icon-edit-outline"></i>
                <span>分类管理</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="sortlist">分类列表</el-menu-item>
                <el-menu-item index="sort">添加分类</el-menu-item>
              </el-menu-item-group>
            </el-submenu>
             <el-submenu index="5">
              <template slot="title">
                <i class="el-icon-document"></i>
                <span>订单管理</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="orderlist">订单列表</el-menu-item>
                <el-menu-item index="order">订单数据</el-menu-item>
              </el-menu-item-group>
            </el-submenu>
            <el-submenu index="6">
              <template slot="title">
                <i class="el-icon-time"></i>
                <span>活动管理</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="1-1">添加活动</el-menu-item>
                <el-menu-item index="1-2">添加优惠券</el-menu-item>
              </el-menu-item-group>
            </el-submenu>
            <el-submenu index="7">
              <template slot="title">
                <i class="el-icon-edit"></i>
                <span>页面设置</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="1-1">幻灯片设置</el-menu-item>
                <el-menu-item index="1-2">导航设置</el-menu-item>
                <el-menu-item index="1-2">魔方图设置</el-menu-item>
              </el-menu-item-group>
            </el-submenu>
            <el-submenu index="8">
              <template slot="title">
                <i class="el-icon-setting"></i>
                <span>系统设置</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="1-1">添加管理员</el-menu-item>
                <el-menu-item index="1-2">管理员列表</el-menu-item>
              </el-menu-item-group>
            </el-submenu>
          </el-menu>
        </el-col>
      </el-aside>
      <el-main>
        <keep-alive>
          <router-view></router-view>
        </keep-alive>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
export default {
  name: "mains",
  data() {
    return {};
  },

  created() {
    this.getSystemInfo();
    this.getCheckToken();
  },
  methods: {
    getSystemInfo() {
      this.$http
        .get("index/getSystemInfo")
        .then(res => {
          console.log(res);
        })
        .catch(err => {
          console.log(err);
        });
    },
    getCheckToken() {
      let token = this.$store.state.token;
      this.$http
        .post("/index/checkTokens", {token})
        .then(res => {
          console.log(res);
        })
        .catch(err => {
          console.log(err);
        });
    },
    handleOpen() {},
    handleClose() {}
  }
};
</script>

<style>
.el-container {
  height: 100vh;
  overflow: hidden;
}
.el-header,
.el-footer {
  background-color: #444444;
  color: #fff;
  text-align: center;
  line-height: 60px;
  height: 70px;
  border-bottom: 1px solid #fff;
}

.el-aside {
  background-color: #444444;
  color: #fff;
  text-align: center;
  line-height: 200px;
  height: 95vh;
  overflow: scroll;
}

.el-main {
  background-color: #f5f5f5;
  color: #333;
  text-align: center;
  height: 95vh;
  padding-bottom: 40px;
}

body > .el-container {
}
.header-img {
  width: 180px;
  height: 54px;
  position: fixed;
  left: 30px;
  top: 0;
}
</style>
